package ninetails;

import java.util.logging.Logger;

public final class ShutdownHook
    extends Thread
{
  private final Logger log = Logger.getLogger(ShutdownHook.class.getName());

  @Override
  public void run()
  {
    log.info("Entering shutdown hook");
    super.run();
    final RLVibe rlVibe = RLVibe.getInstance();
    if (rlVibe != null)
    {
      rlVibe.stop();
      rlVibe.closeDevice();
    }
  }
}